package cn.tedu.attendance.controller;

import cn.tedu.attendance.pojo.dto.AttendanceQuery;
import cn.tedu.attendance.service.AttendanceService;
import cn.tedu.base.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/v1/attendance/")
public class AttendanceController {
    @Autowired
    private AttendanceService attendanceService;

    @GetMapping("select")
    public JsonResult select(AttendanceQuery attendanceQuery) {
        log.debug("开始处理【查询考勤记录】的请求，参数：{}", attendanceQuery);
        List<Map> list = attendanceService.select(attendanceQuery);
        return JsonResult.ok(list);
    }
}